<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta charset="utf-8">
  <title>帐号设置</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/resource/layui/css/layui.css">
  <link rel="stylesheet" href="/resource/css/global.css">
</head>
<body>
<div class="fly-header layui-bg-green">
  <div class="layui-container">
    <a class="fly-logo" href="/user/redirectIndex.do">
      <div class="layui-logo" style="font-size: 20px; color: #CAE1FF;"><span class="iconfont-ali icon-B" style="font-size: 35px"></span></div>
    </a>
    <ul class="layui-nav fly-nav layui-hide-xs">
      <li class="layui-nav-item layui-this">
        <a href="/user/redirectIndex.do"><i class="layui-icon  layui-icon-home"></i>首页</a>
      </li>
    </ul>
    <ul class="layui-nav fly-nav-user">
      <!-- 登入后的状态 -->
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="javascript:;">
          <cite class="layui-hide-xs">${user.userName}</cite>
     		<img <c:if test="${!empty user.headSculpture }">src="${user.headSculpture }"</c:if><c:if test="${empty user.headSculpture }">src="/resource/img/logo.JPG"</c:if> alt="${user.userName}">
        </a>
        <dl class="layui-nav-child layui-bg-green">
       	  <dd><a href="/user/userindex.do"><i class="layui-icon">&#xe609;</i>用户中心</a></dd>
          <dd><a href="/user/userset.do"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
          <dd><a href="/user/usermessage.do"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
          <dd><a href="/user/userhome.do"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
          <hr style="margin: 5px 0;">
          <dd><a href="/user/logout.do" ><i class="iconfont-ali icon-tuichu"></i>退出</a></dd>
        </dl>
      </li>
    </ul>
  </div>
</div>

<div class="layui-container fly-marginTop fly-user-main">
  <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
    <li class="layui-nav-item">
      <a href="/user/userhome.do">
        <i class="layui-icon">&#xe609;</i>
     	   我的主页
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="/user/userindex.do">
        <i class="layui-icon">&#xe612;</i>
      	  用户中心
      </a>
    </li>
    <li class="layui-nav-item layui-this">
      <a href="/user/userset.do">
        <i class="layui-icon">&#xe620;</i>
       	基本设置
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="/user/usermessage.do">
        <i class="layui-icon">&#xe611;</i>
       	我的消息
      </a>
    </li>
  </ul>

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  
  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  
  
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li class="layui-this" lay-id="info">我的资料</li>
        <li lay-id="avatar">头像</li>
        <li lay-id="pass">密码</li>
         <li lay-id="integrate">积分</li>
      </ul>
      <!-- 基本修改 -->
      <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-form layui-form-pane layui-tab-item layui-show">
           <div class="layui-form-item">
              <label for="L_userId" class="layui-form-label">您的ID</label>
              <div class="layui-input-inline">
                <input type="text" id="L_userId" name="userId" autocomplete="off" value="${user.userId }" class="layui-input" readonly>
              </div>
            </div>
            <div class="layui-form-item">
              <label for="L_username" class="layui-form-label">昵称</label>
              <div class="layui-input-inline">
                <input type="text" id="L_username" name="username" required lay-verify="required" autocomplete="off" value="${user.userName }" class="layui-input">
              </div>
              <div class="layui-inline">
                <div class="layui-input-inline" >
                  <input type="radio" lay-filter="sexselect" name="sex" value="1" <c:if test="${user.sex==1 }">checked</c:if> title="男">
                  <input type="radio" lay-filter="sexselect" name="sex" value="0" <c:if test="${user.sex==0 }">checked</c:if> title="女">
                </div>
              </div>
            </div>
            <div class="layui-form-item">
              <label for="L_email" class="layui-form-label">邮箱</label>
              <div class="layui-input-inline">
                <input type="text" id="L_email" name="email" required lay-verify="email" autocomplete="off" value="${user.email }" class="layui-input">
              </div>
              <c:if test="${user.email ==null }"><div class="layui-form-mid layui-word-aux">请完善此信息，并确保邮箱可用！！</div></c:if>
            </div>
            <div class="layui-form-item">
              <label for="L_phone" class="layui-form-label">手机号</label>
              <div class="layui-input-inline">
                <input type="text" id="L_phone" name="phone" autocomplete="off" value="${user.phone }" class="layui-input">
              </div>
              <c:if test="${user.phone==null }"><div class="layui-form-mid layui-word-aux">请完善此信息</div></c:if>
            </div>
            <div class="layui-form-item">
              <label for="L_realname" class="layui-form-label">真实姓名</label>
              <div class="layui-input-inline">
                <input type="text" id="L_realname" name="realname" autocomplete="off" value="${user.realName }" class="layui-input">
              </div>
              <c:if test="${user.realName==null }"><div class="layui-form-mid layui-word-aux">请完善此信息</div></c:if>
            </div>
             <div class="layui-form-item">
              <label for="L_identityNumber" class="layui-form-label">身份证号</label>
              <div class="layui-input-inline">
                <input type="text" id="L_identityNumber" name="identityNumber" autocomplete="off" value="${user.identityNumber }" class="layui-input">
              </div>
              <c:if test="${user.identityNumber ==null }"><div class="layui-form-mid layui-word-aux">请完善此信息</div></c:if>
            </div>
            <div class="layui-form-item">
              <label for="L_birthday" class="layui-form-label">出生日期</label>
              <div class="layui-input-inline">
                <input type="text" id="L_birthday" name="birthday" autocomplete="off" value="${user.birthday }" class="layui-input">
              </div>
              <c:if test="${user.birthday ==null }"><div class="layui-form-mid layui-word-aux">请完善此信息</div></c:if>
            </div>
            <div class="layui-form-item">
              <label for="L_city" class="layui-form-label">城市</label>
              <div class="layui-input-inline">
                <input type="text" id="L_city" name="city" autocomplete="off" value="${user.address }" class="layui-input">
              </div>
               <c:if test="${user.address ==null }"><div class="layui-form-mid layui-word-aux">请完善此信息</div></c:if>
            </div>
             <div class="layui-form-item">
              <label for="L_joinDate" class="layui-form-label">加入日期</label>
              <div class="layui-input-inline">
                <input type="text" id="L_joinDate" name="joinDate" autocomplete="off" value="${user.joinDate }" class="layui-input" readonly>
              </div>
            </div>
            <div class="layui-form-item layui-form-text">
              <label for="L_sign" class="layui-form-label">签名</label>
              <div class="layui-input-block">
              <textarea  id="L_sign"  name="sign"  autocomplete="off" class="layui-textarea" style="height: 80px;">${user.introduce }</textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <button class="layui-btn" key="set-mine" lay-filter="L_submit" lay-submit>确认修改</button>
            </div>
          </div>
          <!-- 头像上传模块 -->
          <div class="layui-form layui-form-pane layui-tab-item">
            <div class="layui-form-item">
              <div class="avatar-add">
                <p>建议尺寸168*168，支持jpg、png、gif，最大不能超过1MB</p>
                <button id="uphead" type="button" class="layui-btn upload-img">
                  <i class="layui-icon">&#xe67c;</i>上传头像
                </button>
                <c:if test="${!empty user.headSculpture }"><img src="${user.headSculpture }"></c:if>
              <%--   <c:if test="${empty user.headSculpture }"><img src="${user.headSculpture }"></c:if> --%>
                <span class="loading"></span>
              </div>
            </div>
          </div>
          <!-- 密码修改模块 -->
          <div class="layui-form layui-form-pane layui-tab-item">
            <form action="/user/repass" method="post">
              <div class="layui-form-item">
                <label for="L_nowpassword" class="layui-form-label">当前密码</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_nowpassword" name="nowpassword" required lay-verify="password" autocomplete="off" class="layui-input" value="${user.password }" readonly >
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">新密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_password" name="password" required lay-verify="password" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
              </div>
              <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">确认密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_repassword" name="repassword" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" key="set-mine" lay-filter="R_submit" lay-submit>确认修改</button>
              </div>
            </form>
          </div>
          
           <div class="layui-form layui-form-pane layui-tab-item">
              <div class="layui-form-item">
                <label for="L_nowpassword" class="layui-form-label">您的积分</label>
                <div class="layui-input-inline">
                  <input type="text" id="B_integration" name="integration" required  autocomplete="off" class="layui-input" value="${user.integration }" readonly >
                </div>
              </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="fly-footer">
  	<p>Believe 社区 2019 &copy; 千夜 出品</p>
</div>

<script type="text/javascript" src="/resource/js/common.js"></script>
<script src="/resource/js/jquery.min.js"></script>
<script src="/resource/layui/layui.js"></script>
<script src="/resource/js/userset.js"></script>
<script>
			//注意：导航 依赖 element 模块，否则无法进行功能性操作
			layui.use('element', function() {
				var element = layui.element;
			});
			//检测session是否过期  或者未登录
			layui.use('layer',function(){
				$(document).ready(function(){
					var se="${user}";
					if(se==""){
					layer.alert('登录过期或未登录，请登录', function(index){
						  window.location.href="/login.html";
						  layer.close(index);
						}); 
					}
				});
			});
		</script>
</body>
</html>